package com.java.jvm.heap;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * -Xmx256m -Xms256m
 */
public class ManyObjectOOMTests {

    public static void main(String[] args)throws Exception {
        List<byte[]> list=new ArrayList<>();
        while(true) {
            byte[] array = new byte[1024 * 1024];
            //list.add(array);
            TimeUnit.MILLISECONDS.sleep(500);
        }
    }
}
